// element-plus配置
const AutoImport = require('unplugin-auto-import/webpack')
const Components = require('unplugin-vue-components/webpack')
const { ElementPlusResolver } = require('unplugin-vue-components/resolvers')

module.exports = {
    // element-plus配置
    configureWebpack: {
        plugins: [
            AutoImport({
                resolvers: [ElementPlusResolver()],
            }),
            Components({
                resolvers: [ElementPlusResolver()],
            }),
        ]
    },
    // devServer配置项
    devServer: {
        open: true,
        proxy: {
            '/api': { //匹配所有以user开头的请求路径
                target: 'http://localhost:3000', //代理目标的基础路径
                pathRewrite: { '^/api': '' },
                ws: true,
                changeOrigin: true
            }
        }
    },

    // 关闭eslint语法检查
    lintOnSave: false
}